package com.ryan.mms.privilage.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.ryan.framework.model.Model;

/**
 * Role entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "role", catalog = "framework")
public class Role implements Model{

	private static final long serialVersionUID = 1L;

	// Fields

	private Long roleId;
	private String roleCode;
	private String roleName;
	private Long roleGroupId;
	private Integer roleType;

	// Constructors

	/** default constructor */
	public Role() {
	}

	/** minimal constructor */
	public Role(String roleCode, String roleName) {
		this.roleCode = roleCode;
		this.roleName = roleName;
	}

	/** full constructor */
	public Role(String roleCode, String roleName, Long roleGroupId,
			Integer roleType) {
		this.roleCode = roleCode;
		this.roleName = roleName;
		this.roleGroupId = roleGroupId;
		this.roleType = roleType;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "role_id", unique = true, nullable = false)
	public Long getRoleId() {
		return this.roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	@Column(name = "role_code", nullable = false, length = 64)
	public String getRoleCode() {
		return this.roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	@Column(name = "role_name", nullable = false, length = 64)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "role_group_id")
	public Long getRoleGroupId() {
		return this.roleGroupId;
	}

	public void setRoleGroupId(Long roleGroupId) {
		this.roleGroupId = roleGroupId;
	}

	@Column(name = "role_type")
	public Integer getRoleType() {
		return this.roleType;
	}

	public void setRoleType(Integer roleType) {
		this.roleType = roleType;
	}

}